import request from '@/utils/request'

/* 获取权限数据 */
export function getPermsList(params) {
  return request({
    url: '/permissions',
    method: 'get',
    params
  })
}

/* 获取权限数量 */
export function getPermsCount() {
  return request({
    url: '/permissions/count',
    method: 'get'
  })
}

/* 获取权限数据 */
export function getPermsById(id) {
  return request({
    url: '/permissions/' + id
  })
}

/* 新建权限 */
export function addPerms(data) {
  return request({
    url: '/permissions',
    method: 'post',
    data
  })
}

/* 编辑权限 */
export function editPerms(data) {
  return request({
    url: '/permissions/' + data.id,
    method: 'put',
    data
  })
}

/* 删除权限 */
export function delPerms(id) {
  return request({
    url: '/permissions/' + id,
    method: 'delete'
  })
}

